#include "linux-uart.h"
#include <stdio.h>

int main(int argc, char const* argv[])
{
    LinuxUart linuxUart("/dev/ttymxc5");
    int       n = 0, i = 0;

    uint8_t txbuf[] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99};
    n               = linuxUart.writeData(txbuf, sizeof(txbuf));
    printf("Linux uart write %d bytes : \n", n);
    for (i = 0; i < n; i++) {
        printf("%02x", txbuf[i]);
    }
    printf("\n");

    uint8_t rxbuf[1024];
    n = linuxUart.readData(rxbuf, sizeof(rxbuf));
    printf("Linux uart read %d bytes : \n", n);
    for (i = 0; i < n; i++) {
        printf("%02x", rxbuf[i]);
    }
    
    printf("\n");
    return 0;
}
